Optimal. Leaf size=140 \[ \frac {2 \left (3 b^2 B+5 a (2 A b+a B)\right ) E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{5 d}+\frac {2 \left (3 a^2 A+A b^2+2 a b B\right ) F\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{3 d}+\frac {2 b (5 A b+7 a B) \sqrt {\cos (c+d x)} \sin (c+d x)}{15 d}+\frac {2 b B \sqrt {\cos (c+d x)} (a+b \cos (c+d x)) \sin (c+d x)}{5 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.18, antiderivative size = 140, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 33, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.152, Rules used = {3069, 3102,
2827, 2720, 2719} \begin {gather*} \frac {2 \left (3 a^2 A+2 a b B+A b^2\right ) F\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{3 d}+\frac {2 \left (5 a (a B+2 A b)+3 b^2 B\right ) E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{5 d}+\frac {2 b (7 a B+5 A b) \sin (c+d x) \sqrt {\cos (c+d x)}}{15 d}+\frac {2 b B \sin (c+d x) \sqrt {\cos (c+d x)} (a+b \cos (c+d x))}{5 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2719
Rule 2720
Rule 2827
Rule 3069
Rule 3102
Rubi steps
\begin {align*} \int \frac {(a+b \cos (c+d x))^2 (A+B \cos (c+d x))}{\sqrt {\cos (c+d x)}} \, dx &=\frac {2 b B \sqrt {\cos (c+d x)} (a+b \cos (c+d x)) \sin (c+d x)}{5 d}+\frac {2}{5} \int \frac {\frac {1}{2} a (5 a A+b B)+\frac {1}{2} \left (3 b^2 B+5 a (2 A b+a B)\right ) \cos (c+d x)+\frac {1}{2} b (5 A b+7 a B) \cos ^2(c+d x)}{\sqrt {\cos (c+d x)}} \, dx\\ &=\frac {2 b (5 A b+7 a B) \sqrt {\cos (c+d x)} \sin (c+d x)}{15 d}+\frac {2 b B \sqrt {\cos (c+d x)} (a+b \cos (c+d x)) \sin (c+d x)}{5 d}+\frac {4}{15} \int \frac {\frac {5}{4} \left (3 a^2 A+A b^2+2 a b B\right )+\frac {3}{4} \left (3 b^2 B+5 a (2 A b+a B)\right ) \cos (c+d x)}{\sqrt {\cos (c+d x)}} \, dx\\ &=\frac {2 b (5 A b+7 a B) \sqrt {\cos (c+d x)} \sin (c+d x)}{15 d}+\frac {2 b B \sqrt {\cos (c+d x)} (a+b \cos (c+d x)) \sin (c+d x)}{5 d}+\frac {1}{3} \left (3 a^2 A+A b^2+2 a b B\right ) \int \frac {1}{\sqrt {\cos (c+d x)}} \, dx+\frac {1}{5} \left (3 b^2 B+5 a (2 A b+a B)\right ) \int \sqrt {\cos (c+d x)} \, dx\\ &=\frac {2 \left (3 b^2 B+5 a (2 A b+a B)\right ) E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{5 d}+\frac {2 \left (3 a^2 A+A b^2+2 a b B\right ) F\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{3 d}+\frac {2 b (5 A b+7 a B) \sqrt {\cos (c+d x)} \sin (c+d x)}{15 d}+\frac {2 b B \sqrt {\cos (c+d x)} (a+b \cos (c+d x)) \sin (c+d x)}{5 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.63, size = 106, normalized size = 0.76 \begin {gather*} \frac {2 \left (3 \left (10 a A b+5 a^2 B+3 b^2 B\right ) E\left (\left .\frac {1}{2} (c+d x)\right |2\right )+5 \left (3 a^2 A+A b^2+2 a b B\right ) F\left (\left .\frac {1}{2} (c+d x)\right |2\right )+b \sqrt {\cos (c+d x)} (5 A b+10 a B+3 b B \cos (c+d x)) \sin (c+d x)\right )}{15 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(486\) vs.
\(2(180)=360\).
time = 0.31, size = 487, normalized size = 3.48
method | result | size |
default | \(-\frac {2 \sqrt {\left (2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1\right ) \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \left (-24 B \cos \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (\sin ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b^{2}+\left (20 A \,b^{2}+40 B a b +24 B \,b^{2}\right ) \left (\sin ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \cos \left (\frac {d x}{2}+\frac {c}{2}\right )+\left (-10 A \,b^{2}-20 B a b -6 B \,b^{2}\right ) \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \cos \left (\frac {d x}{2}+\frac {c}{2}\right )+15 a^{2} A \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, \EllipticF \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )+5 A \,b^{2} \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, \EllipticF \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )-30 A \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, \EllipticE \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right ) a b +10 B a b \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, \EllipticF \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )-15 B \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, \EllipticE \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right ) a^{2}-9 B \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, \EllipticE \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right ) b^{2}\right )}{15 \sqrt {-2 \left (\sin ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}\, \sin \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, d}\) | \(487\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [C] Result contains higher order function than in optimal. Order 9 vs. order
4.
time = 0.14, size = 216, normalized size = 1.54 \begin {gather*} \frac {2 \, {\left (3 \, B b^{2} \cos \left (d x + c\right ) + 10 \, B a b + 5 \, A b^{2}\right )} \sqrt {\cos \left (d x + c\right )} \sin \left (d x + c\right ) - 5 \, \sqrt {2} {\left (3 i \, A a^{2} + 2 i \, B a b + i \, A b^{2}\right )} {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) + i \, \sin \left (d x + c\right )\right ) - 5 \, \sqrt {2} {\left (-3 i \, A a^{2} - 2 i \, B a b - i \, A b^{2}\right )} {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) - i \, \sin \left (d x + c\right )\right ) - 3 \, \sqrt {2} {\left (-5 i \, B a^{2} - 10 i \, A a b - 3 i \, B b^{2}\right )} {\rm weierstrassZeta}\left (-4, 0, {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) + i \, \sin \left (d x + c\right )\right )\right ) - 3 \, \sqrt {2} {\left (5 i \, B a^{2} + 10 i \, A a b + 3 i \, B b^{2}\right )} {\rm weierstrassZeta}\left (-4, 0, {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) - i \, \sin \left (d x + c\right )\right )\right )}{15 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.34, size = 177, normalized size = 1.26 \begin {gather*} \frac {A\,b^2\,\left (\frac {2\,\sqrt {\cos \left (c+d\,x\right )}\,\sin \left (c+d\,x\right )}{3}+\frac {2\,\mathrm {F}\left (\frac {c}{2}+\frac {d\,x}{2}\middle |2\right )}{3}\right )}{d}+\frac {2\,A\,a^2\,\mathrm {F}\left (\frac {c}{2}+\frac {d\,x}{2}\middle |2\right )}{d}+\frac {2\,B\,a^2\,\mathrm {E}\left (\frac {c}{2}+\frac {d\,x}{2}\middle |2\right )}{d}+\frac {2\,B\,a\,b\,\left (\frac {2\,\sqrt {\cos \left (c+d\,x\right )}\,\sin \left (c+d\,x\right )}{3}+\frac {2\,\mathrm {F}\left (\frac {c}{2}+\frac {d\,x}{2}\middle |2\right )}{3}\right )}{d}+\frac {4\,A\,a\,b\,\mathrm {E}\left (\frac {c}{2}+\frac {d\,x}{2}\middle |2\right )}{d}-\frac {2\,B\,b^2\,{\cos \left (c+d\,x\right )}^{7/2}\,\sin \left (c+d\,x\right )\,{{}}_2{\mathrm {F}}_1\left (\frac {1}{2},\frac {7}{4};\ \frac {11}{4};\ {\cos \left (c+d\,x\right )}^2\right )}{7\,d\,\sqrt {{\sin \left (c+d\,x\right )}^2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________